Metal halides are useful for electrorefining metals. However, the production of many metal halides is difficult. In particular, current methods for the production of uranium trichloride (UCl3) on a large scale require handling of highly pyrophoric uranium/uranium hydride fines or the use of toxic cadmium chloride as an oxidizer in a molten salt bath. It is desirable to eliminate the need for both of these reagents. Moreover, it is desirable in some circumstances to provide in-situ production of metal halides such as UCl3. Consequently, improved systems and methods are needed for making metal halides, and in particular for making UCl3 for electrorefining uranium.